import js from "@eslint/js";
import pluginVue from "eslint-plugin-vue";
import tsEslint from "typescript-eslint";

export default [
  { ignores: ["**/node_modules/**", "**/dist/**", "src-tauri/**", "test/**", "src/**"] },
  { files: ["**/*.{js,mjs,cjs,ts,vue}"] },
  js.configs.recommended,
  ...tsEslint.configs.recommended,
  ...pluginVue.configs["flat/recommended"],
  {
    languageOptions: {
      ecmaVersion: 2020
    },
    rules: {
      "no-console": "warn",
      "no-unused-vars": "off",
      "no-undef": "error",
      camelcase: [
        "warn",
        {
          properties: "always",
        },
      ],
      semi: ["warn", "never"],
      "vue/html-indent": ["warn", 2],
      "vue/attribute-hyphenation": "error",
      "vue/html-self-closing": "off",
      "vue/no-v-html": "off",
      "vue/no-unused-components": "warn",
      "vue/require-default-prop": "off",
      "vue/first-attribute-linebreak": ["off"],
      "vue/html-closing-bracket-newline": "off",
      "@typescript-eslint/no-unused-vars": "off",
      "@typescript-eslint/explicit-module-boundary-types": "off",
      "@typescript-eslint/no-explicit-any": "off",
    },
  },
  {
    files: ["**/*.vue"],
    languageOptions: { parserOptions: { parser: tsEslint.parser } },
  },
];
